//链表
#include<stdio.h>
#include<stdlib.h>

struct Node{
    int data;
    struct Node* next;
};
struct Node* head=NULL;
struct Node* Insert_head(struct Node* head,int num){        //以指针形势返回,只能用作头插法 //链表头插
    struct Node* temp=(struct Node*)malloc(sizeof(struct Node));  //C++:Node* temp=new Node();
    temp->data=num;   //(*temp).data=num;
    temp->next=head;  //(*temp).next=head;
    head=temp;
    return head;
}
void print(struct Node* head){
    printf("Lits is:");
    while(head!=NULL){
        printf(" %d",head->data);
        head=head->next;
    }
    printf("\n");
}

int main(){
    int n,num;
    printf("how many numbers?:");
    scanf(" %d",&n);
    for(int i=0;i<n;i++){
        printf("Enter the number:");
        scanf(" %d",&num);
        head=Insert_head(head,num);
        print(head);


    }



}